<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<div style="width: 300px;height: 100px; background: red;position: fixed;"  id="div1"></div>
	
	
	<script>
		var clientWidth=document.documentElement.clientWidth;
		var clientHeight=document.documentElement.clientHeight;		
		var div1=document.getElementById('div1');
	var divwith=div1.offsetWidth;
	
		var divheight=div1.offsetHeight;
		/*alert(divheight)*/
     div1.style.top=(clientHeight-divheight)/2.5+'px';
		div1.style.left= (clientWidth-divwith)/2+'px'
		div1.style.right= (clientWidth-divwith)/2+'px'
		
		
	</script>
	
	
	</body>
</html>
